package com.zb.vo;

import com.zb.entity.ZjBrand;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @Author WEN
 * @Date 2023/8/3 0003
 **/
@Data
@ApiModel("品牌列表结果对象")
public class BrandListVo {
    @ApiModelProperty(value = "品牌ID")
    private Long id;

    @ApiModelProperty(value = "品牌名称")
    private String name;

    @ApiModelProperty(value = "品牌编码")
    private String code;

    @ApiModelProperty(value = "品牌状态：false-启用，true-禁用")
    private Boolean status;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public static BrandListVo beanToVo(ZjBrand brand) {
        BrandListVo vo = new BrandListVo();
        BeanUtils.copyProperties(brand, vo);
        vo.setStatus(brand.getDisabled());
        vo.setCreateTime(brand.getGmtCreate());
        vo.setUpdateTime(brand.getGmtUpdate());
        return vo;
    }

}
